/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Dao;

import Interface.InterfaceClientUL;
import Pojo.ClientUl;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;

/**
 *
 * @author olegk
 */
public class DaoClientUl implements InterfaceClientUL{

    @Override
    public boolean register(Session session, ClientUl clientUL) throws Exception {
        session.save(clientUL);
        return true;
    }

    @Override
    public boolean update(Session session, ClientUl clientUL) throws Exception {
        session.update(clientUL);
        return true;
    }

    @Override
    public boolean delete(Session session, ClientUl clientUL) throws Exception {
        session.delete(clientUL);
        return true;
    }

    @Override
    public List<ClientUl> getAll(Session session) throws Exception {
        String hql="from ClientUl";
        Query query=session.createQuery(hql);        
        List<ClientUl> listClientUL =(List<ClientUl>) query.list();        
        return listClientUL;
    }
    
}
